package com.pms.utils;

import java.util.Enumeration;
import java.util.Hashtable;

import javax.servlet.http.HttpServletRequest;

public class ValueObject {

	private Hashtable htData = new Hashtable();

	//private Hashtable htAttribute = new Hashtable();

	public void put(String paramName, Object object) {
		if (paramName != null && object != null) {
			htData.put(paramName, object);
		}
	}

	public Object get(String paramName) {
		Object returnValue = null;
		if (paramName != null) {
			returnValue = htData.get(paramName);

		}
		return returnValue;

	}

	public void transferToRequest(HttpServletRequest request) {
		Enumeration enumeration = htData.keys();

		while (enumeration.hasMoreElements()) {
			Object objectKey = enumeration.nextElement();
			Object objectValue = htData.get(objectKey);

			request.setAttribute(objectKey.toString(), objectValue);
			//System.out.println("--------objectKey--------"+objectKey.toString());
			//System.out.println("--------objectValue------"+objectValue.toString());
		}

	}
	
	
	public Hashtable getHtData() {
		return htData;
	}



	public void setHtData(Hashtable htData) {
		this.htData = htData;
	}
	

	/*public void setAttribute(String attName , Object attValue)
	 {
	 if(attName != null && attValue != null)
	 {
	 htAttribute.put(attName,attValue);
	 }
	 }
	 
	 
	 public Object getAttribute(String attName)
	 {
	 
	 Object returnValue = null;
	 if(attName != null)
	 {
	 returnValue = htAttribute.get(attName);
	 
	 }
	 return returnValue;
	 
	 }*/

}
